/*+**************************************************************************/
/***                                                                      ***/
/***   This file is distributed under a BSD license.                      ***/
/***   See LICENSE.txt for details.                                       ***/
/***                                                                      ***/
/**************************************************************************+*/

material sVolumeMtrl
{
  vs
  {
    asc vs_2_0                 // hlsl code
    {
      cbuffer sVolumeVS : register(c0) : slot vs 0
      {
        row_major float4x4 mvp;
        row_major float4x4 mv;
        float4 scaleuv;
      };
      
      use sVolumeVS;
      
      void main
      (
        in float3 in_pos : POSITION,
        in float3 in_norm : NORMAL,
        out float4 out_col : COLOR0,
        out float3 out_tex : TEXCOORD0,
        out float4 out_pos : POSITION,
      )
      {
        float4 norm = mul(float4(in_norm,0),mv);
        out_col = float4(-norm.zzz,1);
        out_tex = mul(float4(in_pos.xyz,1),mv)*scaleuv;
        out_pos = mul(float4(in_pos.xyz,1),mvp);
      }
    }
  }

  ps
  {
    asc ps_2_0
    {
      sampler3D s0 : register(s0);

      void main
      (
        in float4 col : COLOR0,
        in float3 tex : TEXCOORD0,
        out float4 result : COLOR0
      )
      {
        result = col * tex3D(s0,tex.xyz);
      }
    }
  }
};

/**************************************************************************+*/
